


<div class="userinfo">
    <script type="text/javascript" src="__PUBLIC__/Js/jquery.artDialog.js?skin=default"></script>
    <load href="./__PUBLIC__/Js/iframeTools.js"/>
    <load href="./__PUBLIC__/Js/my.js"/>
    <load href="./__PUBLIC__/Js/swfupload.js"/>
    <script type="text/javascript" src="./__PUBLIC__/Js/MyDate/WdatePicker.js"></script>
    <script type="text/javascript" src="./Public/js/jgsat.js">

        var APP	 ='__APP__'
        var ROOT   ='__ROOT__'
        var PUBLIC = '__PUBLIC__'
    </script>
    <div class="wind_content1R">
        <span class="wind_content1Rspan">个人资料</span>
        <ul class="wind_content1Rspanson" style="float:right;margin: -32px 20px 0px 0px;">
            <li>完善度</li>
            <li style="margin-top:3px;width:100px;height:10px;background:#DFDFDF;">
                <span id="spanwidth" style="display:block;width:0px;height:10px;background:#DD4F50;"></span>
            </li>
            <li><span id="wind_nius">0</span>%</li>
        </ul>
        <ul class="wind_content1RULs1">
            <form method='post' id="myform2"  action="{:URL('User-Index/product')}" onsubmit="return change_info()">
                <li>
                    <span style="width:167px;">身份类型：供应商</span>
                </li>
                <input type="hidden" name="id" value="{$vo.id}" />
                <li style="margin-top:0px;">
                    <span><a style="color:red;">*</a> 公司名称：</span>
                    <dd><input type="text"  disabled="disabled" name="realname" id="name1" size="12" value="{$vo[username]}" validate=" required:true"/></dd>
                </li>

                <li>
                    <span><a style="color:red;"></a> 固话：</span>
                    <dd> <input type="text" name="tel" id="tel" size="12" value="{$vo[tel]}" /></dd>
                </li>
                <li>
                <span>QQ：</span>
                <input name="qq" type="text" id="name7"  value="{$vo[qq]}" />
                </li>

                <li>
                    <span><a style="color:red;">*</a> 地址：</span>
                    <dd><select name="province" id="province" validate=" required:true" onchange="area_change(this.value, 1,'province','city','area');" class="selt mr5" >
                        <option value="0">省份</option>
                    </select>
                        <select name="city" id="city" validate=" required:true" onchange="area_change(this.value, 2,'province','city','area');" id="city" class="selt mr5" >
                            <option value="0">城市</option>
                        </select>

                        <script>area_change(0, 0,'province','city','area',{if $vo[province]!=0}{$vo[province]}{else}0{/if},{if $vo[city]!=0}{$vo[city]}{else}0{/if},{if $vo[area]!=0}{$vo[area]}{else}0{/if});
                        </script>
                </li>
                <li>
                    <span>&nbsp;</span>
                    <input type="text" name="address" id="address" class="orderinput" value="{$vo[address]}" />
                    </dd>
                </li>
                <li>
                    <span><a style="color:red;"></a> 主营产品：</span>
                    <dd> <input type="text" id="pro" name="product"  size="12" value="{$vo[product]}" /></dd>
                </li>

                <li>
                    <span>公司简介：</span>
                    <textarea name="my_introduce" class="wind_textar1"  id="name10">{$vo[my_introduce]}</textarea>
                </li>
                <li style="margin-top:0px;">
                    <span style="color:red;font-size:12px;line-height:20px;width: 230px;">（带 * 为必填选项）</span>
                </li>
                <li>
                    <input type="hidden" id="avatar" name="avatar"  value="{$vo.avatar}"/>
                    <input type="submit" name="dosubmit" value="保存" class="wind_sub1" />
                </li>
            </form>
        </ul>
        <div class="wind_myhead">
            <div class="wind_myhead_son">
                <img width="100" height="100" id="win_avatar" src="{$vo.avatar}" style="border-radius:6px;margin:21px;" />
                <a href="index.php?g=User&m=Index&a=avatar"><span class="wind_myhead_son2" id="avatar_js">上传头像</span></a>
            </div>
                      <ul class="wind_XX">
            <li><span class="wind_XXspan">绑定邮箱：{if $vo[email]}{$vo[email]} {else} 未设置{/if}</span></li>
            <!--<li><span class="wind_XXspan">绑定手机：178***89</span></li>-->
            <li><span class="wind_XXspan">登录密码：*******</span></li>
          </ul>
          <ul class="wind_XX2">
            <li>{if $vo[email]}<a style="color:#F00"  href="javascript:email_edit()"> 解绑</a>{else} <a style="color:#F00"  href="javascript:email()">立即设置</a>{/if}</li>
            <li><a style="color:#F00" href="index.php?g=User&m=Register&a=edit">修改密码</a></li>
          </ul>

         </div>
     </div>
     <div style="clear:both;margin-bottom:20px;"></div>
 </div>
 </div>
 <script type="text/javascript">
$(document).ready(function(){
    wancheng();
});
 function wancheng(){  
     var num=0;
	 if($("#name1").val()){
		  num+=20+num;
		  
		 }
		 
	 if($("#tel").val()){
		  num=20+num;
		 }
	if($("#name7").val()){
		num=10+num;
		 }  	 	 
     if($("#pro").val()){
		  num=20+num;
		 }
     if($("#city").val()){
		  num=20+num;
		 }
	 
		if($("#name10").val()){
		num=10+num;
		 }
	   	   
		 
    
	$("#spanwidth").css("width",num+"px");
    $("#wind_nius").text(num);
  
 }
 
 
 
 function  email_edit(){
	 
	
    var html=' ';
	html+='<form method="post"  id="form1" action="/index.php?g=User&m=Index&a=delemail" onsubmit="return mailcheckform()">';
	html+='<ul class="wind_zhuce1 yzm_tan" <li>邮箱号码：</li>';
	html+='<input name="mail" type="hidden"  value="{$vo[email]}"  />';
	html+='<li><dd><input type="text" id="email"  placeholder="邮箱号码" disabled="true"  value="{$vo[email]}"   class="reg-form-input rf-input-l" />';
	html+='</dd><a href="#" class="code-box" id="btn_fahou">';
	html+='<input type="button"  style="width: 150px;" class="wind_spans4" value="发送验证码" />';

	
	html+='</a></li><li>邮箱验证码：</li><li><dd>';
	html+='<input type="text" name="verify" class="reg-form-input rf-input-s" id="emyzm"  placeholder="请输入验证码"  />';
	html+='</dd></li><li><input  class="yzm_sub" type="submit" style="cursor: pointer"  value="立即解绑"  /></li></ul></form>';
	 
	 layer.open({
	  type: 1,
	  title :'解绑邮箱',
	  skin: 'layui-layer-rim', //加上边框
	  area: ['420px', '340px'], //宽高
	  content: html
	});
	 }
	 
	function  email(){
	 
	
    var html=' ';
	html+='<form method="post"  id="form1" action="/index.php?g=User&m=Index&a=addemail" onsubmit="return mailcheckform()">';
	html+='<ul class="wind_zhuce1 yzm_tan" <li>邮箱号码：</li>';
	html+='<li><dd><input type="text" id="email" name="mail" placeholder="邮箱号码"  class="reg-form-input rf-input-l" />';
	html+='</dd><a href="#" class="code-box" id="btn_fahou">';
	html+='<input type="button"  style="width: 150px;" class="wind_spans4" value="发送验证码" />';

	
	html+='</a></li><li>邮箱验证码：</li><li><dd>';
	html+='<input type="text" name="verify" class="reg-form-input rf-input-s" id="emyzm"  placeholder="请输入验证码"  />';
	html+='</dd></li><li><input  class="yzm_sub" type="submit" style="cursor: pointer"  value="立即绑定"  /></li></ul></form>';
	 
	 layer.open({
	  type: 1,
	  title :'绑定邮箱',
	  skin: 'layui-layer-rim', //加上边框
	  area: ['420px', '340px'], //宽高
	  content: html
	});
	 } 
	 
	 
	$('.wind_spans4').live("click",function(){
       var mail = $.trim($('#email').val());
       var partten = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
	   //alert(mail)
	  if(partten.test(mail)){
		  $.post('index.php?g=User&m=Index&a=email', {'mail':mail},function(res){
               alert(res);
			  
			  
           });
		 }else{alert('邮箱格式不正确')}
    }); 
	 

function mailcheckform () {
	var email=$("#email").val();
	var emyzm=$("#emyzm").val();
	var partten = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
	  if(partten.test(email)==false){
		 alert('邮箱格式不正确');
		  return false;
		  }
		
	
	  if(email==''){
		  alert('邮箱不能为空');
		  return false;
		  }
	   if(emyzm==''){
		  alert('验证码不能为空');
		  return false;
		  }	  
	
	}	
	
	
	function change_info(){
	var username=$("#name1").val();
	var city=$("#city").val();
	
	
	//alert($(".choice").attr('checked'));
	
	
	//alert(arr)
	//return false;
	    if(city==0)
        {
            alert("请选择您所在的城市!");
            return false;
        }
		
		
     
		if(username=='')
        {
            alert("请输入您的公司名称!");
            return false;
        }
		
		
	}	
	
</script>
 <div class="clear:both;"></div>